<script type="text/javascript">
	var baseweb = '${baseweb}';
</script>
<script type="text/javascript"
        src="${baseweb}/module/decorator/js/listCustomersSetup.js">
</script>
<#setting number_format="0.##">
<#setting locale="en_US">
<div id="tableResult">
<#assign currentPage = command.paging.pageNumber/>
  <#assign nextPage = currentPage + 1/>
  <#assign prevPage = currentPage - 1/>
  <#assign totalPages = command.paging.totalPageNumber - 1/>
<#if result?has_content>
  <table width='100%' border='0' class='results bottomMargin' id='userList'
      cellpadding='0' cellspacing='0'>
      <col width="20%" />
      <col width="20%" />
      <col width="5%" />
      <col width="10%" />
      <col width="8%" />
      <col width="8%" />
      <col width="5%" />
      <col width="24%" />
      <thead>
        <tr>
        <th>Name</th>
        <th>Address</th>
        <th>City</th>
        <th>Contact Info</th>
        <th>Phone</th>
        <th>Cuil</th>
        <th>Balance</th>
        <th>Actions</th>
        </tr>
      </thead>
      <tbody>
        <#list result as customer>
          <#assign styleRow = "">
          <#if !customer.active>
            <#assign styleRow = "style='text-decoration: line-through;'">
          </#if>
          <tr ${styleRow}>
            <td>${customer.name}</td>
            <td>${customer.address}</td>
            <td>${customer.city}</td>
            <td>${customer.contactInfo}</td>
            <td>${customer.phone}</td>
            <td>${customer.cuil}</td>
            <td style="text-align:right">${customer.balance?string("0.00")}</td>
            <td>
              <a href="editCustomer.do?customerId=${customer.id}">Edit</a>
              <a href="listAccountAdjustment.do?customerId=${customer.id}">Account Details</a>
              <a href="#" onclick="javascript: modifyCustomerStatus('modifyCustomerStatus.do?customerId=${customer.id}', ${currentPage});">
              <#if customer.active>
                Deactivate</a>
              <#else>
                Activate</a>
              </#if>
            </td>
          </tr>
        </#list>
    </tbody>
  </table>
</#if>
<#assign currentPage = command.paging.pageNumber/>
  <#assign nextPage = currentPage + 1/>
  <#assign prevPage = currentPage - 1/>
  <#assign totalPages = command.paging.totalPageNumber - 1/>
  <#if totalPages &gt; 0 && currentPage &gt; 0>
     <a href="${baseweb}/module/customer/customers.do?page=${prevPage}">
          &lt;&lt;
     </a>
  </#if>
  Page ${currentPage + 1} of ${totalPages+1}
  <#if totalPages &gt; 0 && currentPage &lt; totalPages>
     <a href="${baseweb}/module/customer/customers.do?page=${nextPage}">
          &gt;&gt;
     </a>
  </#if>
</div>